﻿package plugin.NewSkill.control
{
    import com.core.*;
    import com.greensock.*;
    import com.sh.game.display.*;
    import consts.*;
    import flash.events.*;
    import flash.geom.*;
    import manager.*;
    import morn.core.handlers.*;
    import plugin.NewSkill.*;
    import plugin.NewSkill.consts.*;
    import plugin.bagN.*;
    import plugin.taskdialog.consts.*;
    import pluginfw.nio.*;
    import uiresource.skill.*;
    import view.appDrag.*;
    import view.message.*;
    import view.uilt.*;

    public class SkillUIControl extends SkillUI
    {
        private var mUIBase:Skill;
        private var _skills:Array;
        private var itemArr:Array;
        private var setArr:Array;
        private var baseArr:Array;
        private var advancedArr:Array;
        private var specialArr:Array;
        private var _type:int;
        private var _page:int;
        public var skillId:int;
        private var isother:Boolean;
        private var color1:uint = 11704940;
        private var color2:uint = 16775087;
        private var _mskills:Array;
        private var cfgItem:Object;
        private var cfgSkill:Object;
        private var cfgSkillBook:Object;
        private var cfgGuanzhi:Array;
        private var cfgStore:Object;
        private var _skillid:int = 0;
        private var _index:int = 0;
        private var _bagIndex:int = 0;
        private var _storeid:int = 0;
        private var shulian:Object;
        private var gcolor:uint = 51543;
        private var rcolor:uint = 13051201;
        private var skillitemid:int;
        private var _isshow:Boolean = true;
        private var _eff:XMLMovieClip;
        private var timeline3:TweenMax;
        public static const STR_ARR:Array = [1, 2, 3, 4, 5, "Q", "W", "E", "R", "T", "设"];
        public static const effXml:Class = SkillUIControl_effXml;

        public function SkillUIControl(param1:Skill)
        {
            this.cfgItem = ConfigDictionary.data.item;
            this.cfgSkill = ConfigDictionary.data.skill;
            this.cfgSkillBook = ConfigDictionary.data.skillbook;
            this.cfgGuanzhi = ConfigDictionary.data.guanwei;
            this.cfgStore = ConfigDictionary.data.storeNew;
            this.shulian = [];
            this.mUIBase = param1;
            return;
        }// end function

        override protected function initializeView() : void
        {
            super.initializeView();
            var _loc_1:* = Control.create(SkillControl, this);
            ModelProxy.addObserver("skill", _loc_1);
            this.init();
            this.addListener();
            baseTab.selected = false;
            advancedTab.selected = true;
            specialTab.selected = false;
            specialTab.visible = false;
            return;
        }// end function

        public function openRefresh(param1:Object) : void
        {
            var _loc_2:Output = null;
            advancedTab.selected = true;
            baseTab.selected = false;
            if (param1 != null && param1.skills)
            {
                this._type = 1;
                this._page = 0;
                this.show(param1.skills);
            }
            else
            {
                this._type = 1;
                this._page = 0;
                _loc_2 = new Output();
                PluginManager.instance.sendToBufferServer("skill", CMDSkill.Refresh, _loc_2);
            }
            this.setCount();
            return;
        }// end function

        public function setCount() : void
        {
            var _loc_1:* = ModelProxy.getValue("data", "skillupcount");
            if (int(_loc_1[1]) > 0)
            {
                skillview1.visible = true;
                skillcountLabel1.text = _loc_1[1] + "";
            }
            else
            {
                skillview1.visible = false;
            }
            if (int(_loc_1[2]) > 0)
            {
                skillview.visible = true;
                skillcountLabel.text = _loc_1[2] + "";
            }
            else
            {
                skillview.visible = false;
            }
            return;
        }// end function

        private function init() : void
        {
            var _loc_3:SkillItemUI = null;
            var _loc_4:SkillItemControl = null;
            var _loc_5:ShortUI = null;
            this.itemArr = [];
            var _loc_1:int = 0;
            var _loc_2:* = skillCon.numChildren;
            _loc_1 = 0;
            while (_loc_1 < _loc_2)
            {
                
                _loc_3 = skillCon.getChildAt(_loc_1) as SkillItemUI;
                _loc_4 = new SkillItemControl(_loc_3);
                this.itemArr.push(_loc_4);
                _loc_1++;
            }
            setCon.visible = false;
            setCon.x = 390;
            this.setArr = [];
            _loc_1 = 0;
            while (_loc_1 < 11)
            {
                
                _loc_5 = new ShortUI();
                _loc_5.x = 15 + _loc_1 % 5 * 55;
                _loc_5.keyLabel.text = STR_ARR[_loc_1];
                if (_loc_1 < 5)
                {
                    _loc_5.y = 10;
                    this.setArr.push(_loc_5);
                }
                else if (_loc_1 < 10)
                {
                    _loc_5.y = 10 + 47;
                    this.setArr.push(_loc_5);
                }
                else
                {
                    _loc_5.x = 300;
                    _loc_5.y = 40;
                    _loc_5.keyLabel.text = "空";
                    this.setArr.unshift(_loc_5);
                }
                setCon.addChild(_loc_5);
                _loc_5.addEventListener(MouseEvent.CLICK, this.onShortHandler);
                _loc_1++;
            }
            return;
        }// end function

        private function addListener() : void
        {
            closeBtn.addEventListener(MouseEvent.CLICK, this.onCloseBtnHandler);
            advancedTab.addEventListener(MouseEvent.CLICK, this.onTabClickHandler);
            baseTab.addEventListener(MouseEvent.CLICK, this.onTabClickHandler);
            specialTab.addEventListener(MouseEvent.CLICK, this.onTabClickHandler);
            leftBtn.addEventListener(MouseEvent.CLICK, this.onLeftBtnHandler);
            rightBtn.addEventListener(MouseEvent.CLICK, this.onRightBtnHandler);
            AppDragMgr.addEventListener(AppDragEvent.DRAG, this.onDragHandler);
            btn_lvup.addEventListener(MouseEvent.CLICK, this.upLevel);
            setCon.addEventListener(MouseEvent.CLICK, this.stopEvent);
            this.addEventListener(Event.ADDED_TO_STAGE, this.addStageHandler);
            btn_jihuo.addEventListener(MouseEvent.CLICK, this.studySkill);
            siwangdianLabel.addEventListener(MouseEvent.CLICK, this.clickswdHandler);
            help.addEventListener(MouseEvent.MOUSE_OVER, this.showTips);
            help.addEventListener(MouseEvent.MOUSE_OUT, this.showTips);
            return;
        }// end function

        protected function showTips(event:MouseEvent) : void
        {
            var _loc_2:String = null;
            if (event.type == MouseEvent.MOUSE_OVER)
            {
                _loc_2 = "1.挂机打怪可以增加熟练度\n2.使用技能书增加熟练度";
                ModelProxy.change("tips", "normal", _loc_2);
            }
            else
            {
                ModelProxy.change("tips", "state", "close");
            }
            return;
        }// end function

        protected function clickswdHandler(event:MouseEvent) : void
        {
            var nobj:Object;
            var event:* = event;
            nobj = ConfigDictionary.data.sysnpc[189];
            if (this._isshow)
            {
                Alert2.show("即将传送到尸王殿，是否确认传送？", "", ["确定", "取消"], function (param1:int, param2:Object) : void
            {
                if (param1 == 0)
                {
                    if (ItemUilt.checkMapIsFly())
                    {
                        PluginManager.instance.sendToServer("taskdialog", CMDTaskdialog.Fly, {x:nobj.x, y:nobj.y, tostageid:nobj.stageid});
                        ModelProxy.change("data", "taskfindpath", nobj.npcid);
                        mUIBase.close();
                    }
                }
                else if (param1 == 100)
                {
                    if (ItemUilt.checkMapIsFly())
                    {
                        PluginManager.instance.sendToServer("taskdialog", CMDTaskdialog.Fly, {x:nobj.x, y:nobj.y, tostageid:nobj.stageid});
                        ModelProxy.change("data", "taskfindpath", nobj.npcid);
                        mUIBase.close();
                    }
                    _isshow = false;
                }
                else if (param1 == 101)
                {
                    _isshow = false;
                }
                return;
            }// end function
            , null, false, true, true);
            }
            else if (ItemUilt.checkMapIsFly())
            {
                PluginManager.instance.sendToServer("taskdialog", CMDTaskdialog.Fly, {x:nobj.x, y:nobj.y, tostageid:nobj.stageid});
                ModelProxy.change("data", "taskfindpath", nobj.npcid);
                this.mUIBase.close();
            }
            return;
        }// end function

        private function studySkill(event:MouseEvent) : void
        {
            var _loc_2:* = ItemUilt.getArmIndex(this.skillitemid);
            if (_loc_2 > 0)
            {
                ModelProxy.change("main", "playsound", SoundType.DZ_5);
                PluginManager.instance.sendToServer("bag", CMDBag.UseItem, _loc_2);
                ModelProxy.change("data", "changeid", this.skillitemid);
            }
            return;
        }// end function

        private function inputChangeHandler(event:Event) : void
        {
            var _loc_4:String = null;
            var _loc_5:Array = null;
            var _loc_6:int = 0;
            var _loc_7:int = 0;
            var _loc_8:int = 0;
            var _loc_2:* = ModelProxy.getValue("data", "skillvalue");
            var _loc_3:* = UserData.getBagData();
            if (_loc_3[this._bagIndex])
            {
                _loc_4 = _loc_3[this._bagIndex][4].skilladd;
                _loc_5 = _loc_4.split("#");
                _loc_6 = _loc_5[1];
                _loc_7 = int(_loc_2 / _loc_6);
                _loc_8 = ItemUilt.getCount(this._bagIndex);
                if (_loc_7 < _loc_8)
                {
                    _loc_8 = _loc_7;
                }
            }
            return;
        }// end function

        private function inputMouseDownHandler(event:MouseEvent) : void
        {
            event.stopPropagation();
            return;
        }// end function

        protected function addStageHandler(event:Event) : void
        {
            stage.addEventListener(MouseEvent.CLICK, this.hideKeyBoard);
            return;
        }// end function

        private function stopEvent(event:MouseEvent) : void
        {
            event.stopPropagation();
            return;
        }// end function

        private function upLevel(event:MouseEvent) : void
        {
            PluginManager.instance.sendToServer("skill", CMDSkill.UpSkill, {id:this._skillid});
            return;
        }// end function

        private function onDragHandler(event:AppDragEvent) : void
        {
            var _loc_3:SkillItemControl = null;
            var _loc_4:Object = null;
            var _loc_2:* = event.targetObj as SkillItemUI;
            if (!SkillItemUI)
            {
                return;
            }
            for each (_loc_3 in this.itemArr)
            {
                
                _loc_2 = _loc_3.skillItem;
                if (event.targetObj == _loc_2)
                {
                    _loc_4 = _loc_3.data;
                    if (_loc_4)
                    {
                        if (_loc_4.cfg.skilltype != 0)
                        {
                            ModelProxy.change("fastlist", "dragComplate", {point:new Point(stage.mouseX, stage.mouseY), data:_loc_4.cfg});
                        }
                    }
                    break;
                }
            }
            return;
        }// end function

        private function onCloseBtnHandler(event:MouseEvent) : void
        {
            this.mUIBase.close();
            return;
        }// end function

        protected function onTabClickHandler(event:MouseEvent) : void
        {
            var _loc_2:int = 0;
            switch(event.currentTarget)
            {
                case advancedTab:
                {
                    _loc_2 = 1;
                    break;
                }
                case baseTab:
                {
                    _loc_2 = 2;
                    break;
                }
                case specialTab:
                {
                    _loc_2 = 3;
                    break;
                }
                default:
                {
                    break;
                    break;
                }
            }
            var _loc_3:* = PluginManager.instance.checkOpenLevel("skill", _loc_2);
            if (_loc_3)
            {
                PluginManager.instance.limitError(_loc_3);
                return;
            }
            advancedTab.selected = false;
            baseTab.selected = false;
            specialTab.selected = false;
            switch(event.currentTarget)
            {
                case advancedTab:
                {
                    advancedTab.selected = true;
                    this._type = 1;
                    break;
                }
                case baseTab:
                {
                    baseTab.selected = true;
                    this._type = 0;
                    break;
                }
                case specialTab:
                {
                    specialTab.selected = true;
                    this._type = 2;
                    break;
                }
                default:
                {
                    break;
                    break;
                }
            }
            this._index = 0;
            this.showPage(0);
            return;
        }// end function

        public function hideKeyBoard(event:MouseEvent) : void
        {
            if (setCon.visible)
            {
                setCon.visible = false;
                this.skillId = 0;
            }
            return;
        }// end function

        public function showKeyBoard(param1:int, param2:int) : void
        {
            if (this.skillId == param1)
            {
                setCon.visible = false;
                this.skillId = 0;
            }
            else
            {
                setCon.y = param2;
                this.skillId = param1;
                setCon.visible = true;
            }
            return;
        }// end function

        public function reFreshSkill(param1:Object) : void
        {
            var _loc_2:Object = null;
            this.shulian = [];
            for each (_loc_2 in param1)
            {
                
                this.shulian[_loc_2.skillid] = _loc_2.skillProficiency;
            }
            this.show();
            return;
        }// end function

        public function reFreshSkillShuLian(param1:Object) : void
        {
            this.shulian[param1.skillid] = param1.num;
            this.show();
            return;
        }// end function

        public function show(param1:Object = null) : void
        {
            var _loc_5:Object = null;
            var _loc_6:Object = null;
            var _loc_7:Object = null;
            var _loc_8:Object = null;
            var _loc_9:Object = null;
            var _loc_10:Object = null;
            var _loc_11:Object = null;
            var _loc_12:Object = null;
            var _loc_13:Object = null;
            this._skills = [];
            var _loc_2:* = new Object();
            var _loc_3:* = ConfigDictionary.data.skillgroup;
            var _loc_4:int = 0;
            if (param1)
            {
                this.isother = true;
                ModelProxy.change("data", "otherskill", true);
                _loc_4 = ModelProxy.getValue("data", "otheruser.career");
            }
            else
            {
                ModelProxy.change("data", "otherskill", false);
                param1 = UserData.getUserData("skills");
                _loc_4 = UserData.getUserData("career");
            }
            for (_loc_5 in param1)
            {
                
                if (this.isother)
                {
                    if (this.cfgSkill[_loc_5])
                    {
                        _loc_8 = this.cfgSkill[_loc_5];
                    }
                }
                else
                {
                    param1[_loc_5].skillProficiency = int(this.shulian[_loc_5]);
                    _loc_8 = param1[_loc_5];
                }
                if (_loc_8 is String || _loc_8 is int || _loc_8 is Number)
                {
                    continue;
                }
                if (_loc_8.hasOwnProperty("skillid"))
                {
                    _loc_2[_loc_8.groupid] = _loc_8;
                }
            }
            for (_loc_6 in _loc_3)
            {
                
                _loc_9 = _loc_3[_loc_6];
                if (_loc_9.careertype == 6)
                {
                    if (!_loc_2[_loc_6])
                    {
                        _loc_10 = new Object();
                        _loc_10 = {cfg:_loc_9[1], plus:new Object()};
                        this._skills.push(_loc_10);
                    }
                    else
                    {
                        _loc_11 = new Object();
                        _loc_11 = {cfg:_loc_2[_loc_6], plus:new Object()};
                        this._skills.push(_loc_11);
                        _loc_11.plus.learn = true;
                    }
                    continue;
                }
                if (_loc_9.player == 1 && _loc_9.skilltype != 5 && _loc_9.careertype == _loc_4)
                {
                    if (!_loc_2[_loc_6])
                    {
                        _loc_12 = new Object();
                        _loc_12 = {cfg:_loc_9[1], plus:new Object()};
                        this._skills.push(_loc_12);
                        continue;
                    }
                    _loc_13 = new Object();
                    _loc_13 = {cfg:_loc_2[_loc_6], plus:new Object()};
                    _loc_13.plus.learn = true;
                    this._skills.push(_loc_13);
                }
            }
            this._skills.sort(this.compareFunction);
            this.baseArr = [];
            this.advancedArr = [];
            this.specialArr = [];
            for each (_loc_7 in this._skills)
            {
                
                if (_loc_7.cfg.isgaoji == 2)
                {
                    this.specialArr.push(_loc_7);
                    continue;
                }
                if (int(_loc_7.cfg.skilltype) == 0)
                {
                    this.baseArr.push(_loc_7);
                    continue;
                }
                this.advancedArr.push(_loc_7);
            }
            if (this.baseArr.length > 0)
            {
                baseTab.visible = true;
            }
            else
            {
                baseTab.visible = false;
            }
            this.showPage(this._page);
            setCon.visible = false;
            this.skillId = 0;
            return;
        }// end function

        private function compareFunction(param1:Object, param2:Object) : int
        {
            if (int(param1.cfg.rank) < int(param2.cfg.rank))
            {
                return -1;
            }
            if (int(param1.cfg.rank) > int(param2.cfg.rank))
            {
                return 1;
            }
            return 0;
        }// end function

        public function selectSkill(param1:int) : void
        {
            var _loc_2:Array = null;
            var _loc_3:String = null;
            var _loc_6:Object = null;
            var _loc_7:int = 0;
            var _loc_8:Boolean = false;
            var _loc_9:Object = null;
            var _loc_10:Object = null;
            this._storeid = 0;
            if (this.itemArr.length == 0 || this.itemArr[param1].data == null)
            {
                return;
            }
            var _loc_4:int = 0;
            while (_loc_4 < this.itemArr.length)
            {
                
                (this.itemArr[_loc_4] as SkillItemControl).isselected = false;
                _loc_4++;
            }
            this._index = param1;
            (this.itemArr[this._index] as SkillItemControl).isselected = true;
            var _loc_11:* = this.itemArr[this._index].data.cfg.name;
            Jn1_name.text = this.itemArr[this._index].data.cfg.name;
            Jn_name.text = _loc_11;
            this._skillid = this.itemArr[this._index].data.cfg.skillid;
            if (this.itemArr[this._index].data.plus.learn)
            {
                Lv_txt.text = "lv:" + this.itemArr[this._index].data.cfg.level;
                _loc_3 = this.itemArr[this._index].data.cfg.desc;
                _loc_2 = _loc_3.split("#");
                txt_shan.text = _loc_2[0];
                txt_fan.text = _loc_2[1];
                txt_shi.text = _loc_2[2];
                txt_fu.text = _loc_2[3];
                box_skill1.visible = true;
                skill_txt.visible = true;
                box_need.visible = false;
            }
            else
            {
                Lv_txt.text = "lv:" + 0;
                box_skill1.visible = false;
                this.skillitemid = this.cfgSkillBook[this._skillid];
                _loc_6 = this.cfgItem[this.skillitemid];
                skillitem.data = _loc_6;
                _loc_7 = ItemUilt.getAllCount(this.skillitemid);
                if (_loc_7 > 0)
                {
                    label_num.text = "1/1";
                    btn_jihuo.disabled = false;
                }
                else
                {
                    label_num.text = "0/1";
                    btn_jihuo.disabled = true;
                }
                this._storeid = this.itemArr[this._index].data.cfg.storeid;
                this._skillid = this.itemArr[this._index].data.cfg.skillid - 10;
                skill_txt.visible = false;
                box_need.visible = true;
            }
            var _loc_5:* = this.cfgSkill[this._skillid + 10];
            if (this.cfgSkill[this._skillid + 10])
            {
                skillv.visible = true;
                Lv1_txt.text = "lv:" + _loc_5.level;
                _loc_3 = _loc_5.desc;
                _loc_2 = _loc_3.split("#");
                txt_shan1.text = _loc_2[0];
                txt_fan1.text = _loc_2[1];
                txt_shi1.text = _loc_2[2];
                txt_fu1.text = _loc_2[3];
                _loc_8 = false;
                _loc_9 = UserData.getUserData();
                _loc_10 = UserData.getOnlineData();
                player_txt.text = _loc_9.level + "/" + _loc_5.studylv;
                if (int(_loc_9.level) >= int(_loc_5.studylv))
                {
                    player_txt.color = this.gcolor;
                }
                else
                {
                    _loc_8 = true;
                    player_txt.color = this.rcolor;
                }
                if (!btn_jihuo.disabled)
                {
                    btn_jihuo.disabled = _loc_8;
                }
                if (this.itemArr[this._index].data.plus._flag)
                {
                    _loc_8 = true;
                }
                skill_txt.text = int(this.itemArr[this._index].data.cfg.skillProficiency) + "/" + _loc_5.upcount;
                if (int(this.itemArr[this._index].data.cfg.skillProficiency) >= int(_loc_5.upcount))
                {
                    skill_txt.color = this.gcolor;
                }
                else
                {
                    _loc_8 = true;
                    skill_txt.color = this.rcolor;
                }
                btn_lvup.visible = true;
                lab_no.visible = false;
                if (_loc_8)
                {
                    this.stop();
                }
                else
                {
                    btn_lvup.disabled = _loc_8;
                    this.play();
                }
            }
            else
            {
                lab_no.visible = true;
                skillv.visible = false;
                btn_lvup.visible = false;
            }
            return;
        }// end function

        private function checkIndex() : int
        {
            var _loc_2:int = 0;
            var _loc_4:Object = null;
            var _loc_7:int = 0;
            var _loc_1:Boolean = false;
            var _loc_3:* = UserData.getUserData();
            var _loc_5:* = UserData.getOnlineData();
            if (this._index && this.itemArr[this._index].data)
            {
                _loc_2 = this.itemArr[this._index].data.cfg.skillid;
                if (this.itemArr[this._index].data.plus.learn)
                {
                    _loc_1 = false;
                    _loc_4 = this.cfgSkill[_loc_2 + 10];
                    if (_loc_4)
                    {
                        _loc_7 = ItemUilt.getAllCount(this.cfgSkillBook[int(_loc_4.groupid) + 10]);
                        if (_loc_7 > 0)
                        {
                        }
                        else
                        {
                            _loc_1 = true;
                        }
                    }
                    if (!_loc_1)
                    {
                        return (this.itemArr[this._index].data.plus.index + 1);
                    }
                }
            }
            var _loc_6:int = 0;
            while (_loc_6 < this.itemArr.length)
            {
                
                if (this.itemArr[_loc_6].data)
                {
                    _loc_2 = this.itemArr[_loc_6].data.cfg.skillid;
                    if (this.itemArr[_loc_6].data.plus.learn)
                    {
                        _loc_1 = false;
                        _loc_4 = this.cfgSkill[_loc_2 + 10];
                        if (_loc_4)
                        {
                            if (int(_loc_3.level) >= int(_loc_4.studylv))
                            {
                            }
                            else
                            {
                                _loc_1 = true;
                            }
                            if (this.itemArr[_loc_6].data.plus._flag)
                            {
                                _loc_1 = true;
                            }
                            if (int(this.itemArr[_loc_6].data.cfg.skillProficiency) >= int(_loc_4.upcount))
                            {
                            }
                            else
                            {
                                _loc_1 = true;
                            }
                        }
                        else
                        {
                            _loc_1 = true;
                        }
                        if (!_loc_1)
                        {
                            return (this.itemArr[_loc_6].data.plus.index + 1);
                        }
                    }
                }
                _loc_6++;
            }
            return 0;
        }// end function

        public function play() : void
        {
            if (this.timeline3)
            {
                this.timeline3.kill();
                btn_lvup.filters = [];
            }
            this.timeline3 = TweenMax.to(btn_lvup, 1, {glowFilter:{color:16763904, alpha:1, blurX:6, blurY:6, strength:4}, repeat:int.MAX_VALUE, yoyo:true});
            return;
        }// end function

        public function stop() : void
        {
            if (this.timeline3)
            {
                this.timeline3.kill();
            }
            this.timeline3 = TweenMax.to(btn_lvup, 0.1, {glowFilter:{color:16763904, alpha:0, blurX:6, blurY:6, strength:4}, onComplete:this.doCom});
            return;
        }// end function

        private function doCom() : void
        {
            btn_lvup.disabled = true;
            return;
        }// end function

        private function onRightBtnHandler(event:MouseEvent) : void
        {
            this._index = 0;
            this.showPage((this._page + 1));
            return;
        }// end function

        private function onLeftBtnHandler(event:MouseEvent) : void
        {
            this._index = 0;
            this.showPage((this._page - 1));
            return;
        }// end function

        private function showPage(param1:int = 0) : void
        {
            switch(this._type)
            {
                case 0:
                {
                    this._mskills = this.baseArr;
                    break;
                }
                case 1:
                {
                    this._mskills = this.advancedArr;
                    break;
                }
                case 2:
                {
                    this._mskills = this.specialArr;
                    break;
                }
                default:
                {
                    break;
                }
            }
            var _loc_2:* = this._mskills.length;
            var _loc_3:int = 6;
            var _loc_4:* = Math.ceil(_loc_2 / _loc_3);
            if (param1 > (_loc_4 - 1))
            {
                _loc_4 = param1 + 1;
            }
            this.skillConDispose();
            this._page = param1;
            pageLabel.text = (this._page + 1) + "/" + _loc_4;
            var _loc_5:int = 0;
            var _loc_6:* = this._page * _loc_3;
            while (_loc_6 < (this._page + 1) * _loc_3)
            {
                
                if (_loc_6 < _loc_2)
                {
                    if (this._mskills[_loc_6])
                    {
                        this._mskills[_loc_6].plus.isOther = this.isother;
                        this._mskills[_loc_6].plus.index = _loc_5;
                        this.itemArr[_loc_5].data = this._mskills[_loc_6];
                        _loc_5++;
                        ;
                    }
                }
                _loc_6++;
            }
            if ((this._page + 1) > (_loc_4 - 1) || _loc_4 == 1)
            {
                rightBtn.disabled = true;
            }
            else
            {
                rightBtn.disabled = false;
            }
            if (this._page == 0)
            {
                leftBtn.disabled = true;
            }
            else
            {
                leftBtn.disabled = false;
            }
            var _loc_7:* = this.checkIndex();
            if (this.checkIndex() > 0)
            {
                this._index = _loc_7 - 1;
            }
            this.selectSkill(this._index);
            return;
        }// end function

        private function skillConDispose() : void
        {
            var _loc_1:SkillItemControl = null;
            for each (_loc_1 in this.itemArr)
            {
                
                _loc_1.dispose();
            }
            return;
        }// end function

        private function onShortHandler(event:MouseEvent) : void
        {
            var _loc_2:* = event.currentTarget as ShortUI;
            var _loc_3:* = this.setArr.indexOf(_loc_2);
            PluginManager.instance.sendToServer("skill", CMDSkill.SetSkill, {id:this.skillId, type:1, topos:_loc_3});
            ModelProxy.change("data", "skillGet" + this.skillId, false);
            setCon.visible = false;
            this.skillId = 0;
            return;
        }// end function

        public function showEff() : void
        {
            var _loc_1:* = XMLMcManager.instance.getPluginMc("skill", "skillup");
            if (_loc_1)
            {
                _loc_1.mouseChildren = false;
                _loc_1.interval = int(1000 / 8);
                _loc_1.mouseEnabled = false;
                _loc_1.x = 116;
                _loc_1.y = -15;
                this.addChild(_loc_1);
                _loc_1.playFromTo(-1, (_loc_1.totalFrame - 1), new Handler(this.comHandler));
                _loc_1.visible = true;
            }
            return;
        }// end function

        private function comHandler() : void
        {
            var _loc_1:* = XMLMcManager.instance.getPluginMc("skill", "skillup");
            if (_loc_1 && _loc_1.parent)
            {
                _loc_1.parent.removeChild(_loc_1);
            }
            return;
        }// end function

    }
}
